package bman.tools.net;

import java.net.Socket;
import java.util.logging.Logger;

import static org.junit.Assert.*;

/**
 * A sample Receiver implementation. It just prints out the message.
 * 
 * @author MrJacky
 *
 */
public class DummyReceiver implements Receiver
{
	Logger log = Logger.getLogger(DummyReceiver.class.getName());
	
	public boolean error = false;
	public String errorMsg = "";
	
	public void receive(Socket sourceSocket, byte[] message)
	{
		String m = new String(message);
		
		log.info("Recieved message: "+m);
		if(!RadioTest.msg1.equalsIgnoreCase(m) && !RadioTest.msg2.equalsIgnoreCase(m))
		{
			error = true;
			errorMsg = "Message did not match expected message.";
		}
	}
}
